const pages = import.meta.glob('@/views/**/page.js',{
	eager:true,
	import:'default'
})
const components = import.meta.glob('@/views/**/*.vue')
const router = Object.entries(pages).map(([path,mate])=>{
	const comPath = path.replace('page.js',mate.pathName+'.vue')
	const name = path.replace('/src/views/','').replace('/page.js','');
	path = '/' + mate.pathName;
	return {
		path,
		name,
		mate,
		component: components[comPath],
	}
})

export default router;
